home *** CD-ROM | disk | FTP | other *** search
- /* Program Creator v1.1 */
- /* Copyright (c) 1995 Anssi Blomqvist */
-
- Call rxfuncadd 'SysCreateObject', 'RexxUtil', 'SysCreateObject'
- Say
- Say ' Program Creator version 1.1'
- Say ' ---------------------------'
- Say
- Say '(c) 1995 Anssi Blomqvist, abblomqv@rock.helsinki.fi'
- Say
-
- If Arg(1) = '' Then signal Usage
- Ar = Arg(1)
- Prog = Translate(Ar, ' ', '\')
- Prog = Translate(Prog, ' ', '.')
- Wcount = Words(Prog)
- Ext = Translate(Word(Prog, Wcount))
- If (Ext <> 'EXE') & (Ext <> 'CMD') & (Ext <> 'COM') & (Ext <> 'BAT') Then signal Usage
- Pname = Word(Prog, Wcount-1)
- Caps = (verify(Pname,Xrange('A','Z'))=0)
- Small = (verify(Pname,Xrange('a','z'))=0)
- If Caps | Small then Progname = Insert(Translate(Substr(Pname,1,1)),Translate(Substr(Pname,2),Xrange('a','z'),Xrange('A','Z')))
- Else Progname = Pname
- drive = filespec('d',Ar)
- path = filespec('p',Ar)
- If path<>'' Then path = Substr(path,1,length(path)-1)
- cdir = Directory(Insert(drive,path))
- If cdir ='' then signal error
- If Substr(cdir,length(cdir)) <> '\' then cdir=Insert(cdir,'\')
- Prog = Insert(cdir,filespec('n',Ar))
- Program = Insert('EXENAME=', Prog)
- Say 'Creating program object...'
- Say
-
- result=SysCreateObject("WPProgram", Progname, "<WP_DESKTOP>", Program, "f")
- If result = 1 Then Say 'Object was successfully created.'
- Else Do
- Beep(440,400)
- Say 'Error creating program object!'
- Say "Check that there aren't already an object with the same name on the desktop."
- '@Pause'
- End
- Exit
-
- Usage: Say 'Usage:'
- Say
- Say 'CrProg Filename (with an .EXE .CMD .COM or .BAT -extension)'
- Say 'You can also drag and drop the file on the Program Creator -icon.'
- Say
- '@Pause'
- Exit
-
- Error: Beep(440,400)
- Say 'Invalid path!'
- Exit